package com.yc.cloud.basic.service;

import java.util.List;

public interface BaseCacheService<T> {


    //默认24消失
    long expire = 3600 * 24;

    long week_expire = 3600 * 24 * 7;

    long permanent = -1;

    long oneHour = 3600;

    //临时的超时时间,5分钟,防止缓存穿透
    long tempExpire = 300;

    long randomExpire = 300;

    int maxRetryCount = 2;

    T getByKey(String key);

    void setByKey(String key, T t);

    void setByKey(String key, T t, long expire);

    boolean existByKey(String key);

    List<T> listByKey(String key, long pageNum, long pageSize);

    void delByKey(String key);

    List<T> listAllByKey(String key);

    void lPushAllByCollectionByKey(String key, List<T> list);

    T get(Long id);

    void set(Long id, T t);

    boolean exist(Long id);

    List<T> list(long pageNum, long pageSize);

    List<T> listAll();

    void del(Long id);

}
